<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>用户登录</title>
		<script src="__INDEX__/js/mui.min.js"></script>
		<link href="__INDEX__/css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="__INDEX__/css/iconfont.css" />
		<link rel="stylesheet" href="__INDEX__/css/style.css" />
		<link rel="stylesheet" href="__INDEX__/css/mall.css" />
	</head>
	<body style="background: #C9AA74;">
			<div class="mui-content login_con" style="height: 100%; padding-bottom: 0;">
				<form class="layui-form login_formbox" id="my_form" action="{:url('index/index/login')}" method="post">
				<div class="login_top"><img id='index_img' src="__PUBLIC__/static/logo/1/indexlogo1.png" class="mmp_index_img"></div>
					<div class="mui-input-row">
						<label><span class="iconfont icon-dianhua"></span></label>
						<input id='phone' lay-verify="required|phone|number" name="phone" type="text" class="mui-input-clear mui-input" placeholder="请输入账号">
					</div>
					<div class="mui-input-row">
						<label><span class="iconfont icon-mima"></span></label>
						<input id='pwd' lay-verify="required" name="pwd" type="password" class="mui-input-clear mui-input" placeholder="请输入密码">
					</div>
				<div class="mui-content-padded">
					<p><button id='btn' type="button"  class="login_btn">登 录</button></p>
				</div>
				</form>
			</div>
	</body>
</html>
<script type="text/javascript" src="__PUBLIC__/static/js/jquery.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/static/js/jquery.form.js"></script>
<script type="text/javascript" src="__PUBLIC__/static/layui/layui.all.js"></script>
<script>
	//提交数据
	$('#btn').click(function(){
		
		var phone = $("#phone").val();
		var pwd = $("#pwd").val();
		
		if(phone == "" || phone == null){
			layer.msg("请输入登录手机号码");
			$("#phone").focus();
			return false
		}
		
		if(pwd == "" || pwd == null){
			layer.msg("请输入登录密码");
			$("#pwd").focus();
			return false
		}
		$.ajax({
             	type:"post",
                url:"{:url('index/member/login')}",
                data: $('#my_form').serialize(),//表单数据
                success:function(data){
                    if(data.code==200){
                    	layer.msg(data.msg, {
						  icon: 1,
						  time: 1500 //2秒关闭（如果不配置，默认是3秒）
						}, function(){
							location.href = "{:url('index/member/step1')}";		
						});
                    }else{
                    	layer.msg(data.msg);//保存成功提示
                    }
                }
        });
	})
	
</script>

